package what.basic.textcomponent;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.text.*;

import java.text.MessageFormat;
import java.util.*;
public class Jtextcomponentprint extends JPanel{
	static JTextArea text;
	Jtextcomponentprint(){
		JFrame f=new JFrame("print test");
		f.setContentPane(this);
		f.setVisible(true);
		text=new JTextArea(10,10);
		JButton b=new JButton("print file");
		setLayout(new FlowLayout());
		add(text);
		add(b);
		b.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				try{
					text.print();
					//MessageFormat mf=new MessageFormat("YYYY-MMMM-DDDD");
					//text.print(null, mf));
					//text.print(headerFormat, footerFormat, showPrintDialog, service, attributes, interactive);
				}
				catch(Exception ee){}
			}
		});
	}
	public static void main(String[] args) {
		new Jtextcomponentprint();

	}

}
